package com.zmx.patientend.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.patientend.R;
import com.zmx.patientend.pojo.Message;

import butterknife.BindView;
import butterknife.ButterKnife;
import de.hdodenhof.circleimageview.CircleImageView;

/**
 * 程序猿：胖胖祥
 * 时 间：2020/9/2  19:24
 * 功 能：
 */
public class MessageAdapter extends BaseAdapterRvList<MessageAdapter.ViewHolder, Message> {


    public MessageAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, Message message) {

        holder.title.setText(message.getTitle());
        holder.time.setText(message.getAddtime());

    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {

        MessageAdapter.ViewHolder holder = new MessageAdapter.ViewHolder(inflater.inflate(R.layout.adapter_message, parent, false));
        return holder;
    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.title)
        TextView title;
        @BindView(R.id.time)
        TextView time;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }


    }
    }
